import { FormulaElement } from '@/store/3d/formulaEditor';
import Dexie from 'dexie';

export interface Snapshot {
  index: number;
  elements: FormulaElement[];
}

class EditorDB extends Dexie {
  formulas: Dexie.Table<Snapshot, number>;
  constructor() {
    super('EditorDB');
    this.version(1).stores({
      formulas: '++id',
    })
    this.formulas = this.table('formulas');
  }
}

export const db = new EditorDB();
